package org.jprobe.ui;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Window;

import javax.swing.JFrame;

import org.jprobe.utils.UIUtils;
/**
 *
 * The Main access to startup the application
 *
 * @author Hussain Al-Mutawa
 * @version 1.0
 */
public final class Main extends JFrame {
	/** serial version uid **/
	private static final long serialVersionUID = 6549038251055890286L;
	/** singleton **/
	public transient static final Window MAIN_WINDOW = new Main();

	/** initializes the Main frame and make it ready **/
	private Main(){
		super("jProbe-1.0");
		setJMenuBar(new MenuHandler());
		final MainPanel panel = new MainPanel();
		getContentPane().setLayout(new BorderLayout());
		getContentPane().add(panel,BorderLayout.CENTER);

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setPreferredSize(new Dimension(800,500));
		setSize(getPreferredSize());
		setLocation(UIUtils.getScreenCenterPosition(this));
		pack();
	}

	/**
	 * main entry to the application
	 * @param args
	 */
	public static void main(final String[] args) {
//		javax.swing.SwingUtilities.invokeLater(
//			new Runnable(){
//				@Override
//				public void run() {
					MAIN_WINDOW.setVisible(true);
//				}
//			}
//		);
	}

}
